{% extends "base1.html" %}
{% load staticfiles %}    
    <!-- private css -->
    {% block private_css %}
    <link href="{% static 'css/login.css' %}" rel="stylesheet">
    {% endblock %}
     
    {% block content %}
  
       <div id="loginPane" class="col-xs-offset-3 col-xs-6">
          <div id="loginImg"><img src="{% static 'img/indexLogo.png' %}"/></div>
         
		      <form method="POST" role="form" action="/Accounts/login/" >
           {% csrf_token %}
           <div class="form-group">
           <div>
              <div class="reg_mess"><span class="glyphicon glyphicon-user">*</span></div>
              <div class="reg_mess_input">
              {{ obj1.user }}
              <span id="user_remind" class="error_msg1"></span>
              {%  if obj1.errors.user %}
              <span id="user_error" class="error_msg">{{ obj1.errors.user.0 }}</span>
              {% endif %}
              </div>
           </div> 
           <div>
              <div  class="reg_mess" >
              <span class="glyphicon glyphicon-lock">*</span></div>
              <div class="reg_mess_input">
              {{ obj1.pwd }}
              <span id="pwd_remind" class="error_msg1"></span>
              {%  if obj1.errors.pwd %}
                  <span id="pwd_error" class="error_msg">{{ obj1.errors.pwd.0 }}</span>
              {% endif %}
              </div>
           </div>   
           <button id="loginBtn" type="submit" name="login" class="form-control btn btn-primary center-block">登录</button>
           </div>
           <div class="bindBar">
           <div class="checkbox">
           <label>
           <input type="checkbox" name="rememberPassword"><p>记住密码</p>
           </label>
           </div>
           </div>

           
         </form>
         <form action="/Accounts/register/" method="POST" role="form">
         {% csrf_token %}
           <button id="reg_submit" class="btn btn-primary">注册>></button>
         </form>
       </div> <!-- loginPane -->
       <script type="text/javascript">

/*
      var languages = {};
        languages['english'] = ['mark', 'james'];
        languages['spanish'] = ['amy', 'john'];

$.ajax({
    type: 'POST',
    url:  '/Accounts/register/',
    data: languages,
    dataType: 'json'

});
*/
         $("#reg_submit").click(function(){
            var data = {
                  "p1": "v1",
                  "p2": "v2"
            }
            var xmlhtprq = new XMLHttpRequest();
            url = "/Accouts/register/";
            xmlhtprq.open("POST", url, true);
            xmlhtprq.send(data);
         })
       </script>
{% endblock %}